<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
		    table tr,
			table tr th,
			table tr td {
				border: 1px solid red;
				}
			table {
				width: 450px;
				text-align: left;
				border-collapse: collapse;
			}	
			table #edit{
				cursor: pointer;
			}
		</style>
	</head>

	<body>
		<div id="box">
			<table id="table">
				<thead id="thead">
					<tr>
						<th>
							<input type="checkbox" />全选/全不选
						</th>
						<th>商品名称</th>
						<th>单价</th>
						<th>数量</th>
						<th>小计</th>
						<th>操作</th>
					</tr>

				</thead>
				<tbody id="tbody">
					<!--<tr>
						<td>
						     <input type="checkbox" id="checkAll"/>
						</td>
						<td>redmi</td>
						<td>39元</td>
						<td>1</td>
						<td>39元</td>
						<td>删除</td>
					</tr>-->
				</tbody>
			</table>
		</div>
		<script src="01.js"></script>
		<script>
			console.log(arr);
			var tbody = document.getElementById("tbody");
			tbody.innerHTML = "";
			var str = "";

			for(var i = 0; i < arr.length; i++) {

				str += `<tr>
						<td>
						     <input type="checkbox" id="checkAll"/>
						</td>
						<td>${arr[i].goodsName}</td>
						<td>${arr[i].price}</td>
						<td>1</td>
						<td>${arr[i].price}</td>
						<td id="edit">x</td>
					</tr>
					`
			}
			tbody.innerHTML = str;
		</script>

	</body>

</html>